package com.jiang.smartcommunity.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RatingBar;
import android.widget.Toast;

import com.jiang.smartcommunity.R;


public class S1DActivity extends BaseActivity implements View.OnClickListener {

    private EditText editTextTextPersonName;
    private RatingBar ratingBar;
    private Button button2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_s1_d);
        initView();
        setTitle("评价反馈");


    }

    private void initView() {
        editTextTextPersonName = (EditText) findViewById(R.id.editTextTextPersonName);
        ratingBar = (RatingBar) findViewById(R.id.ratingBar);
        button2 = (Button) findViewById(R.id.button2);

        button2.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.button2:
                submit();
                break;
        }
    }

    private void submit() {
        // validate
        String editTextTextPersonNameString = editTextTextPersonName.getText().toString().trim();
        if (TextUtils.isEmpty(editTextTextPersonNameString)) {
            Toast.makeText(this, "评论反馈不能为空", Toast.LENGTH_SHORT).show();
            return;
        }

        toast("反馈成功！");
        finish();


    }
}